home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Scrap.h
-
- Contains: Scrap Manager Interfaces.
-
- Version: Technology: System 7.5
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __SCRAP__
- #define __SCRAP__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __FILEMANAGER__
- #include <FileManager.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- /*
- _________________________________________________________________________________________________________
- • STUCTURES
- _________________________________________________________________________________________________________
- */
- typedef struct OpaqueScrapRef* ScrapRef;
- typedef UInt32 ScrapItemUserReference;
- typedef OSType ScrapItemType;
- #if FOR_SYSTEM8_PREEMPTIVE
- /*
- _________________________________________________________________________________________________________
- • SCRAP ITEM TYPE ATTRIBUTES
- _________________________________________________________________________________________________________
- */
- typedef OptionBits ScrapItemTypeAttributes;
-
- enum {
- kScrapItemTypeNoAttributes = (0 << 0), /* No scrap item type attributes*/
- kScrapItemTypeSenderOnly = (1 << 0), /* Scrap item type is available to sender only*/
- kScrapItemTypeSenderTranslated = (1 << 1), /* Scrap item type is translated by sender*/
- kScrapItemTypeNotSaved = (1 << 2), /* Scrap item type should not be saved*/
- kScrapItemTypeSystemTranslated = (1 << 8) /* Scrap item type is translated by Scrap Manager*/
- };
-
- /*
- _________________________________________________________________________________________________________
- • FSOBJECTREF SCRAP ITEM TYPE
- _________________________________________________________________________________________________________
- */
-
- enum {
- kScrapItemTypeFSObject = 'fsob' /* scrap item type for FSObjectRef data*/
- };
-
- typedef struct FSObjectScrapItemType FSObjectScrapItemType;
- struct FSObjectScrapItemType {
- FSObjectInformation objectInfo_o; /* FSObject information*/
- FSObjectRef object_t; /* FSObjectRef - Call FSObjectRefRegister() before using*/
- };
-
- /*
- _________________________________________________________________________________________________________
-
- • FSOBJECTREF PROMISE SCRAP ITEM TYPE
- _________________________________________________________________________________________________________
- */
-
- enum {
- kScrapItemTypePromiseFSObject = 'pfob' /* Scrap item type for promised FSObjectRef data*/
- };
-
- typedef struct PromiseFSObjectScrapItemType PromiseFSObjectScrapItemType;
- struct PromiseFSObjectScrapItemType {
- FSObjectInformation objectInfo_o; /* FSObject information*/
- ScrapItemType promisedScrapItemType; /* Promised scrap item type containing an FSObjectRef*/
- };
-
- /*
- _________________________________________________________________________________________________________
- • CREATING & DELETING SCRAPS
- _________________________________________________________________________________________________________
- */
- extern OSStatus NewScrapRef(ScrapRef *scrapReference);
-
- extern OSStatus DisposeScrapRef(ScrapRef scrapReference);
-
- /*
- _________________________________________________________________________________________________________
- • ADDING SCRAP ITEMS
- _________________________________________________________________________________________________________
- */
- extern OSStatus AddScrapItemType(ScrapRef scrapReference, ScrapItemUserReference newOrExistingUserReference, ScrapItemType newItemType, void *data, ByteCount dataSize);
-
- extern OSStatus SetScrapItemTypeData(ScrapRef scrapReference, ScrapItemUserReference existingUserReference, ScrapItemType existingItemType, const void *data, ByteCount dataSize, UInt32 dataOffset);
-
- extern OSStatus SetScrapItemTypeAttributes(ScrapRef scrapReference, ScrapItemUserReference existingUserReference, ScrapItemType existingItemType, ScrapItemTypeAttributes attributes);
-
- extern OSStatus SetScrapItemTypePromiseHint(ScrapRef scrapReference, ScrapItemUserReference existingUserReference, ScrapItemType existingItemType, UInt32 userPromiseHint);
-
- /*
- _________________________________________________________________________________________________________
- • GETTING SCRAP ITEM INFORMATION
- NOTE: ALL INDEXES ARE 1 BASED (1 .. N)
- _________________________________________________________________________________________________________
- */
- extern OSStatus CountScrapItems(ScrapRef scrapReference, ItemCount *numberScrapItems);
-
- extern OSStatus GetScrapItem(ScrapRef scrapReference, UInt32 scrapItemIndex, ScrapItemUserReference *userReference);
-
- extern OSStatus CountScrapItemTypes(ScrapRef scrapReference, ScrapItemUserReference userReference, ItemCount *numberItemTypes);
-
- extern OSStatus GetScrapItemType(ScrapRef scrapReference, ScrapItemUserReference userReference, UInt32 itemTypeIndex, ScrapItemType *itemType);
-
- extern OSStatus GetScrapItemTypeDataSize(ScrapRef scrapReference, ScrapItemUserReference userReference, ScrapItemType itemType, ByteCount *itemTypeDataSize);
-
- extern OSStatus GetScrapItemTypeData(ScrapRef scrapReference, ScrapItemUserReference userReference, ScrapItemType itemType, void *data, ByteCount *dataSize, UInt32 *dataOffset);
-
- extern OSStatus GetScrapItemTypeAttributes(ScrapRef scrapReference, ScrapItemUserReference userReference, ScrapItemType itemType, ScrapItemTypeAttributes *attributes);
-
- #endif
- #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
- /*
- _________________________________________________________________________________________________________
- • CLASSIC SCRAP MANAGER API
- _________________________________________________________________________________________________________
- */
- struct ScrapStuff {
- SInt32 scrapSize;
- Handle scrapHandle;
- SInt16 scrapCount;
- SInt16 scrapState;
- StringPtr scrapName;
- };
- typedef struct ScrapStuff ScrapStuff;
-
- typedef ScrapStuff *PScrapStuff;
- typedef ScrapStuff *ScrapStuffPtr;
- extern pascal ScrapStuffPtr InfoScrap(void )
- ONEWORDINLINE(0xA9F9);
-
- extern pascal SInt32 UnloadScrap(void )
- ONEWORDINLINE(0xA9FA);
-
- extern pascal SInt32 LoadScrap(void )
- ONEWORDINLINE(0xA9FB);
-
- extern pascal SInt32 GetScrap(Handle hDest, ResType theType, SInt32 *offset)
- ONEWORDINLINE(0xA9FD);
-
- extern pascal SInt32 ZeroScrap(void )
- ONEWORDINLINE(0xA9FC);
-
- extern pascal SInt32 PutScrap(SInt32 length, ResType theType, void *source)
- ONEWORDINLINE(0xA9FE);
-
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __SCRAP__ */
-
-